freedex.blogg.se

Open docx hyperlinks in word for mac
Open docx hyperlinks in word for mac





open docx hyperlinks in word for mac

(field.Element(XMLNS + "fldChar") = null) & (((field.Element(XMLNS + "rPr").NextNode as XElement).Value != null)))Įlse if ((status = MergeStatus.HaveData) & (field.Element(XMLNS + "rPr").NextNode != null) & (field.Element(XMLNS + "fldChar").Attribute(XMLNS + "fldCharType").Value.Trim() = "separate"))Įlse if ((status = MergeStatus.HaveSeperator) &

open docx hyperlinks in word for mac

(field.Element(XMLNS + "fldChar").Attribute(XMLNS + "fldCharType").Value != "") & (field.Element(XMLNS + "fldChar").Value != null) & (field.Element(XMLNS + "instrText").Value.Trim().Substring(0, 10) = "MERGEFIELD"))įieldName = GetFieldName(field.Element(XMLNS + "instrText").Value.Trim()) Įlse if ((status = MergeStatus.HaveName) & (field.Element(XMLNS + "instrText").Value.Trim().Length > 10) & (field.Element(XMLNS + "instrText").Value != null) & (field.Element(XMLNS + "instrText") != null) & (field.Attribute(XMLNS + "instr") != null))įieldName = GetFieldName(field.Attribute(XMLNS + "instr").Value.Trim()) Įlse if ((status = MergeStatus.HaveBegin) & (field.Element(XMLNS + "fldChar").Attribute(XMLNS + "fldCharType").Value = "begin")) (field.Element(XMLNS + "fldChar").Attribute(XMLNS + "fldCharType") != null) & (field.Element(XMLNS + "fldChar") != null) & XElement status0 = null, status1 = null, status2 = null, status3 = null, status4 = null įoreach (XElement field in mailMergeFields) Where (el.Name = (XMLNS + "r") || el.Attribute(XMLNS + "instr") != null) Public XElement MergeReplace(XElement newBody, Dictionary row) Process the switches, correct the fieldname. Match m = instructionRegEx.Match(instruction) įieldname = m.Groups.ToString().Trim() Private string GetFieldName(string field) NewText = newText.Substring(0, newText.Length - 1) If (newText.Length > 1 & newText.Substring(newText.Length - 1, 1) = "\"") If (newText.Length > 0 & newText.Substring(0, 1) = "\"") New Uri(dir, UriKind.RelativeOrAbsolute)) įile.WriteAllBytes(tmp.FullName, wrdStream.ToArray()) MainDocumentPart docPart = wordPackage.MainDocumentPart WordPackage.ChangeDocumentType(WordprocessingDocumentType.Document) Using (WordprocessingDocument wordPackage = WordprocessingDocument.Open(wrdStream, true)) I've looked at some solution on the internet, but have not found an working solution yet. In my document i have some Hyperlinks, each hyperlink should be defined dynamically like the mailmerge fields. After a struggle with OpenXML, MailMerge and c#, i now have one last issue to solve.







Open docx hyperlinks in word for mac